package com.eliansun.service.mongo;

import com.mongodb.client.FindIterable;
import com.mongodb.client.result.UpdateResult;
import org.bson.Document;

/**
 *  mongodb wapper
 * @author xpq
 */
public interface IMongoWapper {

    /**
     *
     * @param document condition
     * @return FindIterable<Document>
     */
    public FindIterable<Document> selectByCondition(Document document);

    /**
     *
     * @param document1 condition
     * @return document
     */
    public Document selectOneAndUpdate(Document document1, Document document2);

    /**
     *  get and delete
     * @param document
     * @return
     */
    public Document selectOneAndDelete(Document document);

    /**
     *  remove all
     */
    public void clearAllList();

    /**
     * get list size
     * @return szie
     */
    public long size();

    public void save(Document document);

    public void closeConnection();

    public void setCollectionName(String collectionName);

    public Document selectAndReplace(Document var1, Document var2);

    public UpdateResult updateOne(Document var1, Document var2);
}
